<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width,initial-scale=1">
    <title>Checkbox 多选框 | MyUI 4.x</title>
    <meta name="generator" content="VuePress 1.7.1">
    <link rel="icon" href="/my/favicon.ico">
    <script>
      var _hmt = _hmt || [];
      (function() {
        var hm = document.createElement("script");
        hm.src = "https://hm.baidu.com/hm.js?c4e5f73318b5cb0c389e3d9a05f831cc";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
      })();
    </script>
    <meta name="description" content="MyUI是美亚柏科旗下新德汇出品的Web前端一站式项目工程框架，专注于公检法行业中台系统快速搭建，框架已在多个项目实战检验。">
    <meta http-equiv="Cache-Control" content="no-cache, no-store, must-revalidate">
    <meta http-equiv="Pragma" content="no-cache">
    <meta http-equiv="Expires" content="0">
    
    <link rel="preload" href="/my/assets/css/0.styles.82a18d97.css" as="style"><link rel="preload" href="/my/assets/js/app.fc4964fc.js" as="script"><link rel="preload" href="/my/assets/js/513.edb84f11.js" as="script"><link rel="preload" href="/my/assets/js/1329.ffd1f768.js" as="script"><link rel="preload" href="/my/assets/js/958.935c6658.js" as="script">
    <link rel="stylesheet" href="/my/assets/css/0.styles.82a18d97.css">
  </head>
  <body>
    <div id="app" data-server-rendered="true"><div class="theme-container"><header class="navbar"><div class="sidebar-button"><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" role="img" viewBox="0 0 448 512" class="icon"><path fill="currentColor" d="M436 124H12c-6.627 0-12-5.373-12-12V80c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12zm0 160H12c-6.627 0-12-5.373-12-12v-32c0-6.627 5.373-12 12-12h424c6.627 0 12 5.373 12 12v32c0 6.627-5.373 12-12 12z"></path></svg></div> <a href="/my/" class="home-link router-link-active"><img src="/my/img/logo.png" alt="MyUI 4.x" class="logo"> <span class="site-name can-hide">MyUI 4.x</span></a> <div class="links"><div class="search-box"><input aria-label="Search" autocomplete="off" spellcheck="false" value=""> <!----></div> <nav class="nav-links can-hide"><div class="nav-item"><a href="/my/guide/" class="nav-link">
  指南
</a></div><div class="nav-item"><a href="/my/ui/components/" class="nav-link">
  组件
</a></div><div class="nav-item"><a href="/my/ui/charts/" class="nav-link">
  图表
</a></div><div class="nav-item"><a href="/my/ui/map/" class="nav-link">
  地图
</a></div><div class="nav-item"><a href="/my/ui/go/" class="nav-link">
  关系图
</a></div><div class="nav-item"><a href="/my/ui/icon/" class="nav-link">
  图标
</a></div><div class="nav-item"><a href="/my/ui/pages/" class="nav-link">
  页面
</a></div><div class="nav-item"><a href="http://newgateway.gitee.io/my-web/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  演示
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="JSDoc" class="dropdown-title"><span class="title">JSDoc</span> <span class="arrow down"></span></button> <button type="button" aria-label="JSDoc" class="mobile-dropdown-title"><span class="title">JSDoc</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/my/api/components.html" class="nav-link">
  基础组件
</a></li><li class="dropdown-item"><!----> <a href="/my/api/utils.html" class="nav-link">
  工具函数
</a></li><li class="dropdown-item"><!----> <a href="/my/api/charts.html" class="nav-link">
  图表组件
</a></li><li class="dropdown-item"><!----> <a href="/my/api/map.html" class="nav-link">
  地图组件
</a></li></ul></div></div> <!----></nav></div></header> <div class="sidebar-mask"></div> <aside class="sidebar"><nav class="nav-links"><div class="nav-item"><a href="/my/guide/" class="nav-link">
  指南
</a></div><div class="nav-item"><a href="/my/ui/components/" class="nav-link">
  组件
</a></div><div class="nav-item"><a href="/my/ui/charts/" class="nav-link">
  图表
</a></div><div class="nav-item"><a href="/my/ui/map/" class="nav-link">
  地图
</a></div><div class="nav-item"><a href="/my/ui/go/" class="nav-link">
  关系图
</a></div><div class="nav-item"><a href="/my/ui/icon/" class="nav-link">
  图标
</a></div><div class="nav-item"><a href="/my/ui/pages/" class="nav-link">
  页面
</a></div><div class="nav-item"><a href="http://newgateway.gitee.io/my-web/" target="_blank" rel="noopener noreferrer" class="nav-link external">
  演示
  <span><svg xmlns="http://www.w3.org/2000/svg" aria-hidden="true" focusable="false" x="0px" y="0px" viewBox="0 0 100 100" width="15" height="15" class="icon outbound"><path fill="currentColor" d="M18.8,85.1h56l0,0c2.2,0,4-1.8,4-4v-32h-8v28h-48v-48h28v-8h-32l0,0c-2.2,0-4,1.8-4,4v56C14.8,83.3,16.6,85.1,18.8,85.1z"></path> <polygon fill="currentColor" points="45.7,48.7 51.3,54.3 77.2,28.5 77.2,37.2 85.2,37.2 85.2,14.9 62.8,14.9 62.8,22.9 71.5,22.9"></polygon></svg> <span class="sr-only">(opens new window)</span></span></a></div><div class="nav-item"><div class="dropdown-wrapper"><button type="button" aria-label="JSDoc" class="dropdown-title"><span class="title">JSDoc</span> <span class="arrow down"></span></button> <button type="button" aria-label="JSDoc" class="mobile-dropdown-title"><span class="title">JSDoc</span> <span class="arrow right"></span></button> <ul class="nav-dropdown" style="display:none;"><li class="dropdown-item"><!----> <a href="/my/api/components.html" class="nav-link">
  基础组件
</a></li><li class="dropdown-item"><!----> <a href="/my/api/utils.html" class="nav-link">
  工具函数
</a></li><li class="dropdown-item"><!----> <a href="/my/api/charts.html" class="nav-link">
  图表组件
</a></li><li class="dropdown-item"><!----> <a href="/my/api/map.html" class="nav-link">
  地图组件
</a></li></ul></div></div> <!----></nav>  <ul class="sidebar-links"><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>Basic</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading open"><span>Form</span> <span class="arrow down"></span></p> <ul class="sidebar-links sidebar-group-items"><li><a href="/my/element/cascader.html" class="sidebar-link">Cascader 级联选择器</a></li><li><a href="/my/element/checkbox.html" aria-current="page" class="active sidebar-link">Checkbox 多选框</a><ul class="sidebar-sub-headers"><li class="sidebar-sub-header"><a href="/my/element/checkbox.html#基础用法" class="sidebar-link">基础用法</a></li><li class="sidebar-sub-header"><a href="/my/element/checkbox.html#禁用状态" class="sidebar-link">禁用状态</a></li><li class="sidebar-sub-header"><a href="/my/element/checkbox.html#多选框组" class="sidebar-link">多选框组</a></li><li class="sidebar-sub-header"><a href="/my/element/checkbox.html#indeterminate-状态" class="sidebar-link">indeterminate 状态</a></li><li class="sidebar-sub-header"><a href="/my/element/checkbox.html#可选项目数量的限制" class="sidebar-link">可选项目数量的限制</a></li><li class="sidebar-sub-header"><a href="/my/element/checkbox.html#按钮样式" class="sidebar-link">按钮样式</a></li><li class="sidebar-sub-header"><a href="/my/element/checkbox.html#带有边框" class="sidebar-link">带有边框</a></li><li class="sidebar-sub-header"><a href="/my/element/checkbox.html#checkbox-attributes" class="sidebar-link">Checkbox Attributes</a></li><li class="sidebar-sub-header"><a href="/my/element/checkbox.html#checkbox-events" class="sidebar-link">Checkbox Events</a></li><li class="sidebar-sub-header"><a href="/my/element/checkbox.html#checkbox-group-attributes" class="sidebar-link">Checkbox-group Attributes</a></li><li class="sidebar-sub-header"><a href="/my/element/checkbox.html#checkbox-group-events" class="sidebar-link">Checkbox-group Events</a></li><li class="sidebar-sub-header"><a href="/my/element/checkbox.html#checkbox-button-attributes" class="sidebar-link">Checkbox-button Attributes</a></li></ul></li><li><a href="/my/element/color-picker.html" class="sidebar-link">ColorPicker 颜色选择器</a></li><li><a href="/my/element/date-picker.html" class="sidebar-link">DatePicker 日期选择器</a></li><li><a href="/my/element/datetime-picker.html" class="sidebar-link">DateTimePicker 日期时间选择器</a></li><li><a href="/my/element/form.html" class="sidebar-link">Form 表单</a></li><li><a href="/my/element/input.html" class="sidebar-link">Input 输入框</a></li><li><a href="/my/element/input-number.html" class="sidebar-link">InputNumber 计数器</a></li><li><a href="/my/element/radio.html" class="sidebar-link">Radio 单选框</a></li><li><a href="/my/element/rate.html" class="sidebar-link">Rate 评分</a></li><li><a href="/my/element/select.html" class="sidebar-link">Select 选择器</a></li><li><a href="/my/element/slider.html" class="sidebar-link">Slider 滑块</a></li><li><a href="/my/element/switch.html" class="sidebar-link">Switch 开关</a></li><li><a href="/my/element/time-picker.html" class="sidebar-link">TimePicker 时间选择器</a></li><li><a href="/my/element/transfer.html" class="sidebar-link">Transfer 穿梭框</a></li><li><a href="/my/element/upload.html" class="sidebar-link">Upload 上传</a></li></ul></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>Data</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>Notice</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>Navigation</span> <span class="arrow right"></span></p> <!----></section></li><li><section class="sidebar-group collapsable depth-0"><p class="sidebar-heading"><span>Others</span> <span class="arrow right"></span></p> <!----></section></li></ul> </aside> <main class="page"> <div class="theme-default-content content__default"><h1 id="checkbox-多选框"><a href="#checkbox-多选框" class="header-anchor">#</a> Checkbox 多选框</h1> <p>一组备选项中进行多选</p> <h2 id="基础用法"><a href="#基础用法" class="header-anchor">#</a> 基础用法</h2> <p>单独使用可以表示两种状态之间的切换，写在标签中的内容为 checkbox 按钮后的介绍。</p> <!----><h2 id="禁用状态"><a href="#禁用状态" class="header-anchor">#</a> 禁用状态</h2> <p>多选框不可用状态。</p> <!----><h2 id="多选框组"><a href="#多选框组" class="header-anchor">#</a> 多选框组</h2> <p>适用于多个勾选框绑定到同一个数组的情景，通过是否勾选来表示这一组选项中选中的项。</p> <!----><h2 id="indeterminate-状态"><a href="#indeterminate-状态" class="header-anchor">#</a> indeterminate 状态</h2> <p><code>indeterminate</code> 属性用以表示 checkbox 的不确定状态，一般用于实现全选的效果</p> <!----><h2 id="可选项目数量的限制"><a href="#可选项目数量的限制" class="header-anchor">#</a> 可选项目数量的限制</h2> <p>使用 <code>min</code> 和 <code>max</code> 属性能够限制可以被勾选的项目的数量。</p> <!----><h2 id="按钮样式"><a href="#按钮样式" class="header-anchor">#</a> 按钮样式</h2> <p>按钮样式的多选组合。</p> <!----><h2 id="带有边框"><a href="#带有边框" class="header-anchor">#</a> 带有边框</h2> <!----><h2 id="checkbox-attributes"><a href="#checkbox-attributes" class="header-anchor">#</a> Checkbox Attributes</h2> <table><thead><tr><th>参数</th> <th>说明</th> <th>类型</th> <th>可选值</th> <th>默认值</th></tr></thead> <tbody><tr><td>value / v-model</td> <td>绑定值</td> <td>string / number / boolean</td> <td>—</td> <td>—</td></tr> <tr><td>label</td> <td>选中状态的值（只有在<code>checkbox-group</code>或者绑定对象类型为<code>array</code>时有效）</td> <td>string / number / boolean</td> <td>—</td> <td>—</td></tr> <tr><td>true-label</td> <td>选中时的值</td> <td>string / number</td> <td>—</td> <td>—</td></tr> <tr><td>false-label</td> <td>没有选中时的值</td> <td>string / number</td> <td>—</td> <td>—</td></tr> <tr><td>disabled</td> <td>是否禁用</td> <td>boolean</td> <td>—</td> <td>false</td></tr> <tr><td>border</td> <td>是否显示边框</td> <td>boolean</td> <td>—</td> <td>false</td></tr> <tr><td>size</td> <td>Checkbox 的尺寸，仅在 border 为真时有效</td> <td>string</td> <td>medium / small / mini</td> <td>—</td></tr> <tr><td>name</td> <td>原生 name 属性</td> <td>string</td> <td>—</td> <td>—</td></tr> <tr><td>checked</td> <td>当前是否勾选</td> <td>boolean</td> <td>—</td> <td>false</td></tr> <tr><td>indeterminate</td> <td>设置 indeterminate 状态，只负责样式控制</td> <td>boolean</td> <td>—</td> <td>false</td></tr></tbody></table> <h2 id="checkbox-events"><a href="#checkbox-events" class="header-anchor">#</a> Checkbox Events</h2> <table><thead><tr><th>事件名称</th> <th>说明</th> <th>回调参数</th></tr></thead> <tbody><tr><td>change</td> <td>当绑定值变化时触发的事件</td> <td>更新后的值</td></tr></tbody></table> <h2 id="checkbox-group-attributes"><a href="#checkbox-group-attributes" class="header-anchor">#</a> Checkbox-group Attributes</h2> <table><thead><tr><th>参数</th> <th>说明</th> <th>类型</th> <th>可选值</th> <th>默认值</th></tr></thead> <tbody><tr><td>value / v-model</td> <td>绑定值</td> <td>array</td> <td>—</td> <td>—</td></tr> <tr><td>size</td> <td>多选框组尺寸，仅对按钮形式的 Checkbox 或带有边框的 Checkbox 有效</td> <td>string</td> <td>medium / small / mini</td> <td>—</td></tr> <tr><td>disabled</td> <td>是否禁用</td> <td>boolean</td> <td>—</td> <td>false</td></tr> <tr><td>min</td> <td>可被勾选的 checkbox 的最小数量</td> <td>number</td> <td>—</td> <td>—</td></tr> <tr><td>max</td> <td>可被勾选的 checkbox 的最大数量</td> <td>number</td> <td>—</td> <td>—</td></tr> <tr><td>text-color</td> <td>按钮形式的 Checkbox 激活时的文本颜色</td> <td>string</td> <td>—</td> <td>#ffffff</td></tr> <tr><td>fill</td> <td>按钮形式的 Checkbox 激活时的填充色和边框色</td> <td>string</td> <td>—</td> <td>#409EFF</td></tr></tbody></table> <h2 id="checkbox-group-events"><a href="#checkbox-group-events" class="header-anchor">#</a> Checkbox-group Events</h2> <table><thead><tr><th>事件名称</th> <th>说明</th> <th>回调参数</th></tr></thead> <tbody><tr><td>change</td> <td>当绑定值变化时触发的事件</td> <td>更新后的值</td></tr></tbody></table> <h2 id="checkbox-button-attributes"><a href="#checkbox-button-attributes" class="header-anchor">#</a> Checkbox-button Attributes</h2> <table><thead><tr><th>参数</th> <th>说明</th> <th>类型</th> <th>可选值</th> <th>默认值</th></tr></thead> <tbody><tr><td>label</td> <td>选中状态的值（只有在<code>checkbox-group</code>或者绑定对象类型为<code>array</code>时有效）</td> <td>string / number / boolean</td> <td>—</td> <td>—</td></tr> <tr><td>true-label</td> <td>选中时的值</td> <td>string / number</td> <td>—</td> <td>—</td></tr> <tr><td>false-label</td> <td>没有选中时的值</td> <td>string / number</td> <td>—</td> <td>—</td></tr> <tr><td>disabled</td> <td>是否禁用</td> <td>boolean</td> <td>—</td> <td>false</td></tr> <tr><td>name</td> <td>原生 name 属性</td> <td>string</td> <td>—</td> <td>—</td></tr> <tr><td>checked</td> <td>当前是否勾选</td> <td>boolean</td> <td>—</td> <td>false</td></tr></tbody></table></div> <footer class="page-edit"><!----> <!----></footer> <div class="page-nav"><p class="inner"><span class="prev">
      ←
      <a href="/my/element/cascader.html" class="prev">
        Cascader 级联选择器
      </a></span> <span class="next"><a href="/my/element/color-picker.html">
        ColorPicker 颜色选择器
      </a>
      →
    </span></p></div> </main></div><div class="global-ui"></div></div>
    <script src="/my/assets/js/app.fc4964fc.js" defer></script><script src="/my/assets/js/513.edb84f11.js" defer></script><script src="/my/assets/js/1329.ffd1f768.js" defer></script><script src="/my/assets/js/958.935c6658.js" defer></script>
  </body>
</html>
